001    /**
002     * Created by IntelliJ IDEA.
003     * User: Wei Wang
004     * Date: Apr 14, 2003
005     * Time: 1:09:43 AM
006     */
007    
008    package EVolve;
009    
010    import EVolve.exceptions.DataProcessingException;
011    
012    public class ProcessingThread implements Runnable{
013        private Thread thread = null;
014    
015        public ProcessingThread() {
016            thread = new Thread(this);
017        }
018    
019        public void start() {
020            thread.start();
021        }
022    
023        public void join() throws InterruptedException {
024            thread.join();
025        }
026    
027        public synchronized void run() {
028            try {
029                Scene.getDataManager().sendEvents();
030                Scene.getVisualizationManager().visualize();
031                Scene.setStatus("Visualization finished.");
032            } catch (DataProcessingException e) {
033                Scene.setStatus(e.getMessage());
034            }
035        }
036    }